#-*- coding:UTF-8 -*-

import  tensorflow as tf

W =tf.Variable(2.0,dtype=tf.float32,name="Weight") #权重
b = tf.Variable(1.0,dtype=tf.float32,name="Bias") #偏差
x = tf.placeholder(dtype=tf.float32,name="Inpyt") # 输入

with tf.name_scope("Output"):
    y = W * x + b
# 定义保存日志的路径
path = "./log"
# 创建一个用于初始化所有变量（Variable)的操作

init = tf.global_variables_initializer()

# 创建一个 Session（会话)
with tf.Session() as sess:
    sess.run(init)
    write = tf.summary.FileWriter(path,sess.graph)
    result =  sess.run(y,{x:3.0})
    print("y=%s" % result)
